package cn.ddiancan.auth.service.token;

import java.util.Map;

import cn.ddiancan.auth.constant.RequestSourceEnum;
import lombok.Getter;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.core.AuthorizationGrantType;

@Getter
public class XddAuth2SmsCodeAuthenticationToken extends XddAuth2GrantAuthenticationToken {

    private final String smsCode;

    private final String phoneNumber;

    public XddAuth2SmsCodeAuthenticationToken(Authentication clientPrincipal, Map<String, Object> additionalParameters,
        String smsCode, String phoneNumber, String requestType) {
        super(AuthorizationGrantType.DEVICE_CODE, clientPrincipal, additionalParameters);
        this.smsCode = smsCode;
        this.phoneNumber = phoneNumber;
        this.requestSource = RequestSourceEnum.VERIFY_CODE;
        this.requestType = requestType;
    }
}
